home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / program / 441 / vdisrc12 / vdiattr3.s < prev    next >
Text File  |  1990-11-23  |  4KB  |  115 lines

  1.  
  2. ;*========================================================================
  3. ;*
  4. ;* VDIFAST Public Domain VDI bindings.
  5. ;*
  6. ;*========================================================================
  7.  
  8.             .iif                !(^^macdef VContrl),.include  "vdimacro.s"
  9.                         
  10. ;*************************************************************************
  11. ;*
  12. ;* Attribute functions 3.
  13. ;*  Text- and character-related stuff.
  14. ;*
  15. ;*  _vst_height     - Set text height (absolute).
  16. ;*  _vst_point      - Set text height (points).
  17. ;*  _vst_alignment  - Set text alignment.
  18. ;*
  19. ;*************************************************************************
  20.  
  21. ;*------------------------------------------------------------------------
  22. ;* Set character height, absolute mode.
  23. ;*------------------------------------------------------------------------
  24.  
  25. _vst_height::
  26.             .cargs    #8,.handle.w,.height.w,.charw.l,.charh.l,.cellw.l,.cellh.l
  27.             link      a6,#-8            ;* Allocate ptsout[4].
  28.             
  29.             move.w    .height(a6),-(sp) ;* ptsin[1] = height.
  30.             clr.w      -(sp)            ;* ptsin[0] = 0.
  31.             move.l    sp,a0             ;* Save a pointer to ptsin.
  32.             
  33.             VContrl   #12,,#1
  34.             
  35.             pea       -8(a6)            ;* -> ptsout
  36.             subq.l    #4,sp             ;* -> intout
  37.             move.l    a0,-(sp)          ;* -> ptsin
  38.             subq.l    #4,sp             ;* -> intin
  39.             pea       16(sp)            ;* -> contrl
  40.  
  41.             moveq.l   #$73,d0
  42.             move.l    sp,d1
  43.             trap      #2
  44. returnheight:            
  45.             .cargs    #8,.handle.w,.height.w,.charw.l,.charh.l,.cellw.l,.cellh.l
  46.  
  47.             lea       -8(a6),a1         ;* a1 -> ptsout[0] on stack.
  48.             move.l    .charw(a6),a0     ;* Return character width
  49.             move.w    (a1)+,(a0)        ;* from ptsout[0].
  50.             move.l    .charh(a6),a0     ;* Return character height
  51.             move.w    (a1)+,(a0)        ;* from ptsout[1].
  52.             move.l    .cellw(a6),a0     ;* Return cell width
  53.             move.w    (a1)+,(a0)        ;* from ptsout[2].
  54.             move.l    .cellh(a6),a0     ;* Return cell height
  55.             move.w    (a1),(a0)         ;* from ptsout[3].
  56.             
  57.             unlk      a6
  58.             rts
  59.  
  60. ;*------------------------------------------------------------------------
  61. ;* Set character height, points mode.
  62. ;*------------------------------------------------------------------------
  63.  
  64. _vst_point::
  65.  
  66.             .cargs    #8,.handle.w,.height.w,.charw.l,.charh.l,.cellw.l,.cellh.l
  67.             link      a6,#-10            ;* Allocate ptsout[4], intout[1].
  68.             
  69.             VContrl   #107,,,#1
  70.             
  71.             pea       -8(a6)           ;* -> ptsout
  72.             pea       -10(a6)          ;* -> intout
  73.             subq.l    #4,sp            ;* -> ptsin
  74.             pea       .height(a6)      ;* -> intin
  75.             pea       16(sp)           ;* -> contrl
  76.  
  77.             moveq.l   #$73,d0
  78.             move.l    sp,d1
  79.             trap      #2
  80.  
  81.             move.w    -10(a6),d0        ;* Return pt size from intout[0]
  82.             bra       returnheight      ;* Return rest from ptsout[].
  83.  
  84. ;*------------------------------------------------------------------------
  85. ;* Set text alignment.
  86. ;*------------------------------------------------------------------------
  87.  
  88. _vst_alignment::
  89.             .cargs    #8,.handle.w,.hin.w,.vin.w,.hout.l,.vout.l
  90.             link      a6,#-4            ;* Allocate intout[2].
  91.             
  92.             VContrl   #39,,,#2
  93.             
  94.             subq.l    #4,sp            ;* -> ptsout
  95.             pea       -4(a6)           ;* -> intout
  96.             subq.l    #4,sp            ;* -> ptsin
  97.             pea       .hin(a6)         ;* -> intin
  98.             pea       16(sp)           ;* -> contrl
  99.  
  100.             moveq.l   #$73,d0
  101.             move.l    sp,d1
  102.             trap      #2
  103.             
  104.             move.l    .hout(a6),a0      ;* Return horizontal 
  105.             move.w    -4(a6),(a0)       ;* from intout[0].
  106.             move.l    .vout(a6),a0      ;* Return vertical
  107.             move.w    -2(a6),(a0)       ;* from intout[1].
  108.  
  109.             unlk      a6
  110.             rts
  111.  
  112.  
  113. ;*           end of attributes code.
  114.  
  115.